package Thread;

/*
 * Author: JacksonCoder
 * FileName: ImplementRunnable
 * Version: 1.0.0
 * Date: 2025/1/21
 */

class MyRunnable implements Runnable {

    @Override
    public void run() {
        // 线程代码
        for (int i = 0; i < 1000; i++) {
            System.out.println("线程执行中: " + (int) (i + 1));
        }
    }
}

public class ImplementRunnable {

    public static void main(String[] args) {
//        MyRunnable r = new MyRunnable();
//        Thread t = new Thread(r);
        Thread t = new Thread(new MyRunnable());
        t.start(); // 启动线程
    }

}
